import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

/**
 * @author VernHe
 * @date 2021年10月23日 17:53
 */
public class Solution_0448 {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> result = new LinkedList<>();
        if (nums == null || nums.length == 0) {
            return result;
        }
        int len = nums.length;
        int[] allNumber = new int[nums.length + 1];

        for (int i = 0; i < len; i++) {
            allNumber[nums[i]]--;
        }
        for (int i = 1; i <= len; i++) {
            if (allNumber[i] == 0) {
                result.add(i);
            }
        }
        return result;
    }

    public static void main(String[] args) {
//        System.out.println(new Solution_0448().findDisappearedNumbers(new int[]{4, 3, 2, 7, 8, 2, 3, 1}));
        System.out.println(new Solution_0448().findDisappearedNumbers(new int[]{1,1}));
    }
}
